﻿using System.Runtime.Serialization;
using Silverlight.Training.Client.Common;

namespace Silverlight.Training.Client.Common.ServiceReference.Contracts
{
    [DataContract(Namespace = ServiceConstants.ServiceNamespace, Name = "Employee")]
    public class Employee : NotifyPropertyChangedBase
    {
        private int id;
        private string name;
        private string description;
        private JobTitle jobTitle;
        private EmployeeType employeeType;
        private Department deparment;

        [DataMember]
        public int ID
        {
            get { return id; }
            set
            {
                if (!id.Equals(value))
                {
                    id = value;
                    RaisePropertyChanged("ID");
                }
            }
        }

        [DataMember]
        public string Name
        {
            get { return name; }
            set
            {
                if (!ReferenceEquals(value, name))
                {
                    name = value;
                    RaisePropertyChanged("Name");
                }
            }
        }

        [DataMember]
        public string Description
        {
            get { return description; }
            set
            {
                if (!ReferenceEquals(value, description))
                {
                    description = value;
                    RaisePropertyChanged("Description");
                }
            }
        }

        [DataMember]
        public JobTitle JobTitle
        {
            get { return jobTitle; }
            set
            {
                if (!ReferenceEquals(value, jobTitle))
                {
                    jobTitle = value;
                    RaisePropertyChanged("JobTitle");
                }
            }
        }

        [DataMember]
        public Department Department
        {
            get { return deparment; }
            set
            {
                if (!ReferenceEquals(value, deparment))
                {
                    deparment = value;
                    RaisePropertyChanged("Department");
                }
            }
        }

        [DataMember]
        public EmployeeType EmployeeType
        {
            get { return employeeType; }
            set
            {
                if (!ReferenceEquals(value, employeeType))
                {
                    employeeType = value;
                    RaisePropertyChanged("EmployeeType");
                }
            }
        }

    }
}
